package com.ctl.shardingsphere.controller;

import com.ctl.shardingsphere.model.DsStore;
import com.ctl.shardingsphere.service.DsStoreService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @Classname UserController
 * @Description 用户测试控制类
 * @Author ctl
 * @Date 2019-06-28 17:36
 * @Version 1.0
 */
@Slf4j
@RestController
@RequestMapping("/store")
public class StoreController {

    @Autowired(required = false)
    private DsStoreService dsStoreService;

    @GetMapping("/select")
    public List<DsStore> select() {
        return dsStoreService.getDsStoreList();
    }

    @GetMapping("/insert")
    public Boolean insert(DsStore dsStore) {
        return dsStoreService.save(dsStore);
    }


}